'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});
exports.dateFormatFactory = exports.dateFormat = undefined;

var _tinydate = require('tinydate');

var _tinydate2 = _interopRequireDefault(_tinydate);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var memoize = {};
var dateFormat = exports.dateFormat = function dateFormat(date, format) {
    if (!(format in memoize)) {
        memoize[format] = (0, _tinydate2.default)(format);
    }
    return memoize[format](date);
};
var dateFormatFactory = exports.dateFormatFactory = _tinydate2.default;
exports.default = dateFormat;